package com.weikuang.fareast.network;



import com.weikuang.fareast.bean.AddOrderInBean;
import com.weikuang.fareast.bean.AddOrderOutBean;
import com.weikuang.fareast.bean.BranchCodeList;
import com.weikuang.fareast.bean.BranchListByCustomer;
import com.weikuang.fareast.bean.ChangListBean;
import com.weikuang.fareast.bean.ChangOrderBean;
import com.weikuang.fareast.bean.CustomerBean;
import com.weikuang.fareast.bean.DriverListBean;
import com.weikuang.fareast.bean.LoginHttp;
import com.weikuang.fareast.bean.LoginNewBean;
import com.weikuang.fareast.bean.OrderBean;
import com.weikuang.fareast.bean.OrderDetailListBean;
import com.weikuang.fareast.bean.OrderListBean;
import com.weikuang.fareast.bean.ProductsByBranchBean;
import com.weikuang.fareast.bean.QueryInAndOutInfoBean;
import com.weikuang.fareast.bean.UpdateOrderDetailBean;

import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

/**
 * Created by csh on 2021/1/25
 * 接口
 */
public interface KillerApi {

    /**
     * 检测更新
     *
     * @return
     */
    @POST("auth/login")
    Observable<LoginNewBean> login(@Body LoginHttp loginHttp);

    @GET("api/orderManager/getCustomerListByUsername")
    Observable<CustomerBean> getCustomer(@Query("userId") String userId,@Query("driverCode") String driverCode,@Query("week") String week);//客户列表

    @GET("api/orderManager/getBranchListByCustomer")
    Observable<BranchListByCustomer> getBranchListByCustomer(@Query("userId") String userId,@Query("customerId") String customerId,@Query("driverCode") String driverCode,@Query("week") String week);//分行列表

    @GET("api/orderManager/getProductsByBranch")
    Observable<ProductsByBranchBean> getProductsByBranch(@Query("userId") String userId,@Query("branchId") String branchId);

    @GET("api/orderManager/getDriverList")
    Observable<DriverListBean> getDriverList(@Query("userId") String userId);

    @POST("api/orderManager/addOrderIn")
    Observable<OrderBean> addOrderIn(@Body AddOrderInBean addOrderInBean);


    @GET("api/orderManager/getInOrderList")
    Observable<OrderListBean> getInOrderList(@Query("branchId") String branchId, @Query("createBy") String createBy, @Query("customerId") String customerId,@Query("startTime") String startTime, @Query("endTime") String endTime);

    @GET("api/orderManager/getInOrderDetailList")
    Observable<OrderDetailListBean> getInOrderDetailList(@Query("userId") String userId,@Query("relId") String relId);

    @POST("api/orderManager/addOrderOut")
    Observable<OrderBean> addOrderOut(@Body AddOrderOutBean addOrderInBean);

    @GET("api/orderManager/queryInAndOutInfo")
    Observable<QueryInAndOutInfoBean> queryInAndOutInfo(@Query("userId") String userId,@Query("branchId") String branchId, @Query("createBy") String createBy, @Query("customerId") String customerId,
    @Query("endTime") String endTime, @Query("startTime") String startTime, @Query("type") String type,@Query("orderNo") String orderNo);

    @GET("api/orderManager/querySalary")
    Observable<OrderBean> querySalary(@Query("createBy") String createBy, @Query("monthFlag") String monthFlag, @Query("startTime") String startTime,
                                                        @Query("endTime") String endTime);

    @GET("api/orderManager/getOrderList")
    Observable<ChangOrderBean> getOrderList(@Query("userId") String userId,@Query("branchId") String branchId, @Query("createBy") String createBy, @Query("customerId") String customerId,
                                            @Query("startTime") String startTime, @Query("endTime") String endTime, @Query("type") String type);

    @POST("api/orderManager/updateOrderDetail")
    Observable<OrderBean> updateOrderDetail(@Query("userId") String userId,@Body UpdateOrderDetailBean updateOrderDetailBean);


    @GET("api/orderManager/queryInAndOutInfo")
    Observable<QueryInAndOutInfoBean> queryChangInfo( @Query("createBy") String createBy,@Query("userId") String userId,@Query("orderNo") String orderNo,@Query("type") String type);

    @GET("api/orderManager/getBranchCodeList")
    Observable<BranchCodeList> getBranchCodeList(@Query("userId") String userId,@Query("branchCode") String branchCode);
}